Optimal. Leaf size=80 \[ \frac {(f+g)^2 (1+x)^4}{5 \left (1-x^2\right )^{5/2}}+\frac {(f-9 g) (f+g) (1+x)^3}{15 \left (1-x^2\right )^{3/2}}+\frac {2 g^2 (1+x)}{\sqrt {1-x^2}}-g^2 \sin ^{-1}(x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {867, 1649, 803,
667, 222} \begin {gather*} -g^2 \text {ArcSin}(x)+\frac {(x+1)^4 (f+g)^2}{5 \left (1-x^2\right )^{5/2}}+\frac {(x+1)^3 (f-9 g) (f+g)}{15 \left (1-x^2\right )^{3/2}}+\frac {2 g^2 (x+1)}{\sqrt {1-x^2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 222
Rule 667
Rule 803
Rule 867
Rule 1649
Rubi steps
\begin {align*} \int \frac {(f+g x)^2 \sqrt {1-x^2}}{(1-x)^4} \, dx &=\int \frac {(1+x)^4 (f+g x)^2}{\left (1-x^2\right )^{7/2}} \, dx\\ &=\frac {(f+g)^2 (1+x)^4}{5 \left (1-x^2\right )^{5/2}}-\frac {1}{5} \int \frac {(1+x)^3 \left (-f^2+8 f g+4 g^2+5 g^2 x\right )}{\left (1-x^2\right )^{5/2}} \, dx\\ &=\frac {(f+g)^2 (1+x)^4}{5 \left (1-x^2\right )^{5/2}}+\frac {(f-9 g) (f+g) (1+x)^3}{15 \left (1-x^2\right )^{3/2}}+g^2 \int \frac {(1+x)^2}{\left (1-x^2\right )^{3/2}} \, dx\\ &=\frac {(f+g)^2 (1+x)^4}{5 \left (1-x^2\right )^{5/2}}+\frac {(f-9 g) (f+g) (1+x)^3}{15 \left (1-x^2\right )^{3/2}}+\frac {2 g^2 (1+x)}{\sqrt {1-x^2}}-g^2 \int \frac {1}{\sqrt {1-x^2}} \, dx\\ &=\frac {(f+g)^2 (1+x)^4}{5 \left (1-x^2\right )^{5/2}}+\frac {(f-9 g) (f+g) (1+x)^3}{15 \left (1-x^2\right )^{3/2}}+\frac {2 g^2 (1+x)}{\sqrt {1-x^2}}-g^2 \sin ^{-1}(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.35, size = 86, normalized size = 1.08 \begin {gather*} \frac {\sqrt {1-x^2} \left (f^2 \left (-4-3 x+x^2\right )-2 f g \left (-1+3 x+4 x^2\right )-3 g^2 \left (8-19 x+13 x^2\right )\right )}{15 (-1+x)^3}+2 g^2 \tan ^{-1}\left (\frac {\sqrt {1-x^2}}{1+x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 125, normalized size = 1.56
method | result | size |
risch | \(-\frac {\left (1+x \right ) \left (f^{2} x^{2}-8 f g \,x^{2}-39 g^{2} x^{2}-3 f^{2} x -6 f g x +57 g^{2} x -4 f^{2}+2 f g -24 g^{2}\right )}{15 \left (-1+x \right )^{2} \sqrt {-x^{2}+1}}-g^{2} \arcsin \left (x \right )\) | \(82\) |
trager | \(\frac {\left (f^{2} x^{2}-8 f g \,x^{2}-39 g^{2} x^{2}-3 f^{2} x -6 f g x +57 g^{2} x -4 f^{2}+2 f g -24 g^{2}\right ) \sqrt {-x^{2}+1}}{15 \left (-1+x \right )^{3}}+g^{2} \RootOf \left (\textit {\_Z}^{2}+1\right ) \ln \left (-\RootOf \left (\textit {\_Z}^{2}+1\right ) \sqrt {-x^{2}+1}+x \right )\) | \(102\) |
default | \(\left (f^{2}+2 f g +g^{2}\right ) \left (\frac {\left (-\left (-1+x \right )^{2}+2-2 x \right )^{\frac {3}{2}}}{5 \left (-1+x \right )^{4}}-\frac {\left (-\left (-1+x \right )^{2}+2-2 x \right )^{\frac {3}{2}}}{15 \left (-1+x \right )^{3}}\right )+g^{2} \left (\frac {\left (-\left (-1+x \right )^{2}+2-2 x \right )^{\frac {3}{2}}}{\left (-1+x \right )^{2}}+\sqrt {-\left (-1+x \right )^{2}+2-2 x}-\arcsin \left (x \right )\right )+\frac {2 g \left (f +g \right ) \left (-\left (-1+x \right )^{2}+2-2 x \right )^{\frac {3}{2}}}{3 \left (-1+x \right )^{3}}\) | \(125\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 193 vs.
\(2 (70) = 140\).
time = 2.42, size = 193, normalized size = 2.41 \begin {gather*} \frac {2 \, {\left (2 \, f^{2} - f g + 12 \, g^{2}\right )} x^{3} - 6 \, {\left (2 \, f^{2} - f g + 12 \, g^{2}\right )} x^{2} - 4 \, f^{2} + 2 \, f g - 24 \, g^{2} + 6 \, {\left (2 \, f^{2} - f g + 12 \, g^{2}\right )} x + 30 \, {\left (g^{2} x^{3} - 3 \, g^{2} x^{2} + 3 \, g^{2} x - g^{2}\right )} \arctan \left (\frac {\sqrt {-x^{2} + 1} - 1}{x}\right ) + {\left ({\left (f^{2} - 8 \, f g - 39 \, g^{2}\right )} x^{2} - 4 \, f^{2} + 2 \, f g - 24 \, g^{2} - 3 \, {\left (f^{2} + 2 \, f g - 19 \, g^{2}\right )} x\right )} \sqrt {-x^{2} + 1}}{15 \, {\left (x^{3} - 3 \, x^{2} + 3 \, x - 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {- \left (x - 1\right ) \left (x + 1\right )} \left (f + g x\right )^{2}}{\left (x - 1\right )^{4}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 266 vs.
\(2 (70) = 140\).
time = 3.38, size = 266, normalized size = 3.32 \begin {gather*} -g^{2} \arcsin \left (x\right ) + \frac {2 \, {\left (4 \, f^{2} - 2 \, f g + 24 \, g^{2} + \frac {5 \, f^{2} {\left (\sqrt {-x^{2} + 1} - 1\right )}}{x} - \frac {10 \, f g {\left (\sqrt {-x^{2} + 1} - 1\right )}}{x} + \frac {105 \, g^{2} {\left (\sqrt {-x^{2} + 1} - 1\right )}}{x} + \frac {25 \, f^{2} {\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}}{x^{2}} + \frac {10 \, f g {\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}}{x^{2}} + \frac {165 \, g^{2} {\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}}{x^{2}} + \frac {15 \, f^{2} {\left (\sqrt {-x^{2} + 1} - 1\right )}^{3}}{x^{3}} - \frac {30 \, f g {\left (\sqrt {-x^{2} + 1} - 1\right )}^{3}}{x^{3}} + \frac {75 \, g^{2} {\left (\sqrt {-x^{2} + 1} - 1\right )}^{3}}{x^{3}} + \frac {15 \, f^{2} {\left (\sqrt {-x^{2} + 1} - 1\right )}^{4}}{x^{4}} + \frac {15 \, g^{2} {\left (\sqrt {-x^{2} + 1} - 1\right )}^{4}}{x^{4}}\right )}}{15 \, {\left (\frac {\sqrt {-x^{2} + 1} - 1}{x} + 1\right )}^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.96, size = 164, normalized size = 2.05 \begin {gather*} \sqrt {1-x^2}\,\left (\frac {\frac {f^2}{3}+2\,f\,g+\frac {5\,g^2}{3}}{x-1}-\frac {\frac {f^2}{3}+2\,f\,g+\frac {5\,g^2}{3}}{{\left (x-1\right )}^2}\right )-\sqrt {1-x^2}\,\left (\frac {\frac {2\,f^2}{5}+\frac {4\,f\,g}{5}+\frac {2\,g^2}{5}}{{\left (x-1\right )}^3}+\frac {\frac {4\,f^2}{15}+\frac {8\,f\,g}{15}+\frac {4\,g^2}{15}}{x-1}-\frac {\frac {4\,f^2}{15}+\frac {8\,f\,g}{15}+\frac {4\,g^2}{15}}{{\left (x-1\right )}^2}\right )-g^2\,\mathrm {asin}\left (x\right )-\frac {\sqrt {1-x^2}\,\left (4\,g^2+2\,f\,g\right )}{x-1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________